<?

class Log
{
	static function Error($text)
	{
		
		//print $text;
			
		Log::Write($text, Sslib::Variable('log.error.path'));
	}
	static function Write($text, $path)
	{
		
		
	    if($text === FALSE) $text = 'FALSE';
	    else if($text === TRUE) $text = 'TRUE';
	    
	    if(stripos(Sslib::Variable('page.charset'),'UTF-8')===FALSE)
	        $text = Text::Convert(Sslib::Variable('page.charset'), 'UTF-8', $text);
	      
	    $f = @fopen($path, 'a');
	    if($f === FALSE)
	    	new Err($text.'<br /><small style="color:red;">Can\'t open log file</small>'.': '.$path);
	    
		fwrite($f, date(Sslib::Variable('log.format.date'))."$text\n");
		fclose($f);
	}
}

?>